﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Gerenciador/Gerenciador.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="CasaisEmEdificacao.Gerenciador.noticia.index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titulo" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="modulo" runat="server">
    Modulo Notícias
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pagina" runat="server">
    Lista de Notícias cadastradas
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="acoesModulo" runat="server">
    
    <h1>
        <asp:HyperLink ID="linkNovaNoticia" NavigateUrl="~/Gerenciador/noticia/form_noticia.aspx"  runat="server">Nova notícia</asp:HyperLink>
    </h1>
    
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="conteudo" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        
        <asp:Label ID="lblMensagem" runat="server"></asp:Label>

        <center>
            <asp:GridView ID="grdNoticia" runat="server" CellPadding="4" 
                ForeColor="#333333" GridLines="None" Width="95%" 
                AutoGenerateColumns="false" onrowcommand="grdNoticia_RowCommand">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />

                <Columns>
                
                    <asp:TemplateField ShowHeader="false" AccessibleHeaderText="Status" 
                        HeaderText="Status">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkStatus" runat="server" CommandName="Status"
                                CommandArgument='<%#Eval("CO_NOTICIA")%>' Visible="True">
                                <img alt="Status" border="0" src="../common/img_gerenciador/ico_acoes/<%#Eval("CO_SITUACAO").ToString() == "0" ? "inativo.png" : "ativo.png"%>" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle BorderWidth="1" Font-Bold="false" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>

                    <asp:boundfield datafield="DS_TITULO"
                    readonly="true"       
                    headertext="Título da Notícia">
                    <HeaderStyle BorderWidth="1" Font-Bold="false" HorizontalAlign="Left" />
                    <ItemStyle HorizontalAlign="Left" Font-Size="10pt" />
                    </asp:boundfield>

                    <asp:TemplateField ShowHeader="false" AccessibleHeaderText="Editar" 
                    HeaderText="Editar">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkEditar" runat="server" CommandName="Editar"
                                CommandArgument='<%#Eval("CO_NOTICIA")%>' Visible="True">
                                <asp:Image ID="imgEditar" ImageUrl="~/Gerenciador/common/img_gerenciador/ico_acoes/editar.png"  runat="server" BorderWidth="0"/>    
                            </asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle BorderWidth="1" Font-Bold="false" Width="30px" />
                        <ItemStyle/>
                    </asp:TemplateField>

                    <asp:TemplateField ShowHeader="false" AccessibleHeaderText="Excluir" 
                    HeaderText="Excluir">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkExcluir" runat="server" CommandName="Excluir"
                                CommandArgument='<%#Eval("CO_NOTICIA")%>' Visible="True">
                                <asp:Image ID="imgExcluir" ImageUrl="~/Gerenciador/common/img_gerenciador/ico_acoes/excluir.png"  runat="server" BorderWidth="0"/>    
                            </asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle BorderWidth="1" Font-Bold="false" Width="30px" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>

                </Columns>

            </asp:GridView>
        </center>
    </ContentTemplate>
    </asp:UpdatePanel>

    <asp:UpdateProgress ID="UpdateProgress1" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanel1" runat="server">
        <ProgressTemplate>
            <div style="position:absolute;width:500px;height:500px;background-color:Red;">
                Carregando ...
            </div>    
        </ProgressTemplate>
    </asp:UpdateProgress>

</asp:Content>
